<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- 兼容性 -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <title>计划编制-关键节点计划列表</title>
    <script src="/scripts/boot.js"></script>
    <!--<link rel="stylesheet" href="/scripts/res/css/table.css">-->
    <style>
        html,body{
            margin:0;padding: 0;border:0;width:100%;height:100%;overflow:auto;
        }
        body{
            background: #ffffff!important;
            padding:20px;
        }
        /*table*/
        /*{*/
            /*border-collapse: collapse;*/
            /*margin: 0 auto;*/
            /*!*text-align: center;*!*/
        /*}*/
        /*table td, table th*/
        /*{*/
            /*border: 1px solid #eef5fa;*/
            /*color: #666;*/
            /*height: 16px;*/
            /*padding-left: 5px;*/
        /*}*/
        /*table thead th*/
        /*{*/
            /*background-color: #CCE8EB;*/
            /*width: 100px;*/
        /*}*/
        /*table tr:nth-child(odd)*/
        /*{*/
            /*background: #fff;*/
        /*}*/
        /*table tr:nth-child(even)*/
        /*{*/
            /*background: #F5FAFA;*/
        /*}*/
    </style>
</head>
<body>
<!--<table class="table-bg" border="0" cellpadding="1" cellspacing="1" style="width:100%;table-layout:fixed;">-->
    <!--<tr>-->
        <!--<th width="40">编号</th>-->
        <!--<th>计划名称</th>-->
        <!--<th width="60">业务板块</th>-->
        <!--<th>节点名称</th>-->
        <!--<th>完成标准</th>-->
        <!--<th width="50">状态</th>-->
        <!--<th width="50">进度</th>-->
        <!--<th width="160">计划起止时间</th>-->
        <!--<th width="60">负责人</th>-->
    <!--</tr>-->
    <!--<tr>-->
        <!--<td align="center">1</td>-->
        <!--<td>东方希望关键计划东方希望关键计划东方希望关键计划东方希望关键计划东方希望关键计划</td>-->
        <!--<td align="center">项目拓展</td>-->
        <!--<td>土地成交确认书签订土地成交确认书签订土地成交确认书签订土地成交确认书签订土地成交确认书签订</td>-->
        <!--<td>完成签订，合同原件备案完成签订，合同原件备案完成签订，合同原件备案完成签订，合同原件备案</td>-->
        <!--<td align="center">已完成</td>-->
        <!--<td align="center">100.0%</td>-->
        <!--<td align="center">2018-02-16至2018-09-13</td>-->
        <!--<td align="center">负责人人</td>-->
    <!--</tr>-->
<!--</table>-->
<table class="table-bg" id="print_table" border="0" cellpadding="1" cellspacing="1" style="width:100%;table-layout:fixed;border-collapse:collapse; font-size: 13px;">
    <tr>
        <th colspan="7" style="border: 1px solid #cad9ea;width: 100%;text-align: center;">职能工作计划</th>
    </tr>
    <tr>
        <th style="border: 1px solid #cad9ea; width:40px">编号</th>
        <th style="border: 1px solid #cad9ea;">计划名称</th>
        <th style="border: 1px solid #cad9ea;">节点名称</th>
        <th style="border: 1px solid #cad9ea; width:70px">状态</th>
        <th style="border: 1px solid #cad9ea; width:50px" >进度</th>
        <th style="border: 1px solid #cad9ea; width:200px">计划起止时间</th>
        <th style="border: 1px solid #cad9ea; width:60px">负责人</th>
    </tr>
    <!--<tr>-->
        <!--<td align="center">1</td>-->
        <!--<td>+planName+</td>-->
        <!--<td align="center">+businessName+</td>-->
        <!--<td>+nodeName+</td>-->
        <!--<td>+completeStandard+</td>-->
        <!--<td align="center">+state+</td>-->
        <!--<td align="center">+rate+</td>-->
        <!--<td align="center">+beginDate+</td>-->
        <!--<td align="center">+postName+</td>-->
    <!--</tr>-->
</table>
<!--<div class="mini-fit"></div>-->
<div class="chose-toolbar">
    <a class="chose-button" onclick="CloseWindow('close')">取消</a>
    <a class="chose-button save-button" onclick="print.printTable()">确认打印</a>
</div>
<script type="text/javascript">
    var print = {
        //页面初始化
        init: function() {
            mini.parse();
        },
        SetData:function(data){
            $.ajax({
                url: "/functionPlanNodeExecution/listByPage",
                type : "post",
                data:data,
                success: function (text) {
                    var textData = eval("(" + text + ")");
                    var printData = textData.data;
                    var print_div = $("#print_table");
                    var _tr,stateText;
                    for(var i=0;i<printData.length;i++){
                        if(printData[i].state=="1"){
                            stateText = '<span>未开始</span>';
                        }else if(printData[i].state=="2"){
                            stateText = '<span class="span-green">进行中</span>';
                        }else if(printData[i].state=="3"){
                            stateText = '<span class="span-yellow">有风险</span>';
                        }else if(printData[i].state=="4"){
                            stateText = '<span class="span-red">失控</span>';
                        }else if(printData[i].state=="5"){
                            stateText = '<span>已完成</span>';
                        }else if(printData[i].state=="6"){
                            stateText = '<span>延期完成</span>';
                        }else if(printData[i].state=="7"){
                            stateText = '<span class="span-orange">逾期</span>';
                        }
                        _tr = '<tr>'+
                        '<td style="border: 1px solid #cad9ea; text-align: center;">'+(i+1)+'</td>'+
                        '<td style="border: 1px solid #cad9ea; line-height: 15px;">'+printData[i].planName+'</td>'+
                        '<td style="border: 1px solid #cad9ea; line-height: 15px;">'+printData[i].nodeName+'</td>'+
                        '<td style="border: 1px solid #cad9ea; text-align: center;">'+stateText+'</td>'+
                        '<td style="border: 1px solid #cad9ea; text-align: center;">'+printData[i].rate+'%</td>'+
                        '<td style="border: 1px solid #cad9ea; text-align: center;">'+printData[i].beginDate.substring(0,10)+(printData[i].beginDate||printData[i].endDate?"至":"")+printData[i].endDate.substring(0,10)+'</td>'+
                        '<td style="border: 1px solid #cad9ea; text-align: center;">'+printData[i].postName+'</td>'+
                        '</tr>';
                        print_div.append(_tr);
                    }

                }
            });
        },
        //打印
        printTable:function () {
            $("#print_table").print({
                //Use Global styles
                globalStyles : false,
                //Add link with attrbute media=print
                mediaPrint : false,
                //Custom stylesheet
                stylesheet : "http://fonts.googleapis.com/css?family=Inconsolata",
                //Print in a hidden iframe
                iframe : false,
                //Don't print this
                noPrintSelector : ".avoid-this",
                //Add this at top
                //prepend : "Hello World!!!&lt;br/&gt;",
                //Add this on bottom
                // append : "&lt;br/&gt;Buh Bye!",
                //Log to console when printing is done via a deffered callback
                deferred: $.Deferred().done(function() { console.log('Printing done', arguments); })
            });
        }
    };
    print.init();
</script>
</body>
</html>